package com.example.simplecardtenantbank.repository;

import com.example.simplecardtenantbank.dataobject.TBankbill;
import com.example.simplecardtenantbank.form.BankBillForm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TBankbillRepository {
    @Select("select * from t_bankbill where cardId=#{cardId} order by paymentDueDate desc limit 1")
    public TBankbill findByCardId(String cardId);

    @Select("select * from t_bankbill where cardId=#{cardId} order by paymentDueDate desc limit #{num}")
    public List<TBankbill> findByCardIds(BankBillForm bankBillForm);

    @Select("select count(*) from t_bankbill where cardId=#{cardId}")
    public Integer getCountByCardId(String cardId);
}
